import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/Home'
import User from '@/components/User'
import ShuMa from '@/components/ShuMa'
import Login from '@/components/Login'
import phone from '@/components/phone'
import Scategory from '@/components/Scategory'
import FLPhone from '@/components/FLPhone'
import setting from '@/components/setting'
import PersonInfo from '@/components/PersonInfo'
import SetUser from '@/components/SetUser'
import SendMessage from '@/components/SendMessage'
import details from '@/components/details'
import UserDetails from '@/components/UserDetails'
import attention from '@/components/attention'
import Fans from '@/components/Fans'
import shangchuan from '@/components/shangchuan'
import Module from '@/components/Module'
import ChangePhoto from '@/components/ChangePhoto'
import Category from '@/components/Category'
import Register from '@/components/Register'
import selectModule from '@/components/selectModule'
import Address from '@/components/Address'
import AddressEdit from '@/components/AddressEdit'
import Edit from '@/components/Edit'
import Order from '@/components/Order'
import SellUsed from '@/components/SellUsed'
import tradedetail from '@/components/tradedetail'
import buy from '@/components/buy'
import orderdetail from '@/components/orderdetail'
import seller from '@/components/seller'
import account from '@/components/account'

Vue.use(Router)

export default new Router({
  routes: [
    { path: '/', redirect: '/home' },
    // 首页
    { path: '/home', name: 'Home', component: Home },
    { path: '/shangchaun', name: 'shangchuan', component: shangchuan },
    // 用户中心
    { path: '/user', name: 'User', component: User },
    // 数码
    {
      path: '/shuma', name: 'ShuMa', component: ShuMa, children: [
        { path: 'shuma/phone', name: 'phone', component: phone },
      ]
    },
    // 登录
    {
      path: '/login', name: 'Login', component: Login, meta: {
        keepAlive: false
      }
    },// 注册
    {
      path: '/register', name: 'Register', component: Register, meta: {
        keepAlive: false
      }
    },
    // 设置
    {
      path: '/setting', name: 'setting', component: setting, meta: {
        keepAlive: false
      }
    },
    // 头像与个人信息
    {
      path: '/personinfo', name: 'PersonInfo', component: PersonInfo, meta: {
        keepAlive: false
      }
    },
    // 更改头像
    {
      path: '/changephoto', name: 'ChangePhoto', component: ChangePhoto, meta: {
        keepAlive: false
      }
    },
    // 模块
    {
      path: '/module', name: 'Module', component: Module, meta: {
        keepAlive: false
      }
    },
    // 品牌分类
    {
      path: '/category', name: 'Category', component: Category, meta: {
        keepAlive: false
      }
    },
    // 编辑资料
    {
      path: '/setuser', name: 'SetUser', component: SetUser, meta: {
        keepAlive: false
      }
    },
    // 发布动态
    {
      path: '/sendmessage', name: 'SendMessage', component: SendMessage, meta: {
        keepAlive: false
      }
    },
    // 选择发布模块
    {
      path: '/selectmodule', name: 'selectModule', component: selectModule, meta: {
        keepAlive: false
      }
    },
    // 查看动态
    {
      path: '/detail', name: 'details', component: details, meta: {
        keepAlive: false
      }
    },
    // 个人动态
    {
      path: '/userdetail', name: 'UserDetails', component: UserDetails, meta: {
        keepAlive: false
      }
    },
    // 个人关注
    {
      path: '/attention', name: 'attention', component: attention, meta: {
        keepAlive: false
      }
    },
    // 个人粉丝
    {
      path: '/fans', name: 'Fans', component: Fans, meta: {
        keepAlive: false
      }
    },
    {
      path: '/scategory', name: 'Scategory', component: Scategory, children: [
        {
          path: 'flphone', name: 'FLPhone', component: FLPhone, meta: {
            keepAlive: false
          }
        }
      ], meta: {
        keepAlive: false
      }
    },
    // 收货地址
    {
      path: '/address', name: 'Address', component: Address, meta: {
        keepAlive: false
      }
    },
    // 新增联系人
    {
      path: '/addressedit', name: 'AddressEdit', component: AddressEdit, meta: {
        keepAlive: false
      }
    },
    // 编辑地址
    {
      path: '/edit', name: 'Edit', component: Edit, meta: {
        keepAlive: false
      }
    },
    // 发布二手动态
    {
      path: '/sellused', name: 'SellUsed', component: SellUsed, meta: {
        keepAlive: false
      }
    },
    // 订单中心
    {
      path: '/order', name: 'Order', component: Order, meta: {
        keepAlive: false
      }
    },
    // 我卖出的
    {
      path: '/seller', name: 'seller', component: seller, meta: {
        keepAlive: false
      }
    },
    // 交易详情
    {
      path: '/tradedetail', name: 'tradedetail', component: tradedetail, meta: {
        keepAlive: false
      }
    },
    // 购买
    {
      path: '/buy', name: 'buy', component: buy, meta: {
        keepAlive: false
      }
    },
    // 订单详情
    {
      path: '/orderdetail', name: 'orderdetail', component: orderdetail, meta: {
        keepAlive: false
      }
    },
    // 钱包
    {
      path: '/account', name: 'account', component: account, meta: {
        keepAlive: false
      }
    },
  ]
})
